package com.szj.service.impl;

import com.szj.entity.Clazz;
import com.szj.entity.LoginForm;
import com.szj.entity.Student;
import com.szj.entity.Teacher;
import com.szj.mapper.StudentMapper;
import com.szj.service.StudentService;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class StudentServiceImpl implements StudentService {
    @Autowired
    private StudentMapper studentMapper;

    @Override
    public List<Clazz> ClazzNameAll() {
        return studentMapper.ClazzNameAll();
    }


    //学生登录
    @Override
    public Student login(LoginForm loginForm) {
        return studentMapper.login(loginForm);
    }


    //修改学生密码信息
    // TODO: 根据id修改指定学生密码
    @Override
    public int updatePassword(Student student) {
        return studentMapper.updatePassword(student);
    }


    //添加学生信息
    @Override
    public int studentAdd(Student student) {
        return studentMapper.studentAdd(student);
    }


    //删除年级信
    @Override
    public int stuDel(Integer[]ids) {
        return studentMapper.stuDel(ids);
    }


    //修改学生信息
    @Override
    public int studentUp(Student student) {
        return studentMapper.studentUp(student);
    }


    //查找学生名称是否存在
    @Override
    public Student findByName(String name) {
        return studentMapper.findByName(name);
    }


    //查询年级信息
    @Override
    public List<Student> selectList(Student student) {
        return studentMapper.selectList(student);
    }


}